<?php ob_start(); ?>

<?php
	error_reporting(0);
// index.php file  
    include_once("../controller/controller.php");  
    require_once '../model/global.inc.php';  
    $controller = new Controller(); 
	if(isset($_SESSION['logged_in'])){
         $user = unserialize($_SESSION['user']);
         $memid = $user->memid;
      	 $isadmin = $user->isadmin;
      	 
    if($isadmin == 0){header("Location: ../index.php");}}
    else header("Location: ../login.php");
?>
<html>
	<head>
        <link rel="stylesheet" type="text/css" href="product/css/styles.css">
        <link rel="stylesheet" type="text/css" href="product/css/css-admin.css">
	</head>
	<body>
    <div id ="wrap">  
		<div>
                        <div id="site"><a href="../index.php">Publish Site</a></div>
			<div id ="banner"></div>
			<div class="header-admin">
				<a href="index.php" >Home</a>   |   My Account   |   Achievement   |   <a href="view/login/register.php">Register</a>    |   Help
			</div>
		</div>
        <div class="content">
			<div id ="menu-left">
				
				<ul> <strong>Product management</strong>
					<ol><a href="index.php?page=insert">Insert Product</a></ol> 
					<ol><a href="index.php?page=prolist">Product List</a></ol>
				</ul>
				<ul> <strong>Member management</strong>
					<ol><a href="index.php?page=memlist">Member List</a></ol>
				</ul>
				<ul> <strong>Category management</strong>
					<ol><a href="index.php?page=catelist">Category List</a></ol>
				</ul>
			</div>
			<div id = "content-pro">
			<?php
				if(isset($_GET['page']) && $_GET['page']=='insert')
				{
					$controller->product();  
				}
				else if(isset($_GET['page']) && $_GET['page']=='memlist')
				{
					$controller->memlist();  
				}
				else if(isset($_GET['page']) && $_GET['page']=='prolist')
				{
					$controller->prolist();  
				}
				else if(isset($_GET['page']) && $_GET['page']=='catelist')
				{
					$controller->catelist();  
				}
			?>
			</div>
        </div>
        <div style="clear:both"></div>
		<div class="footerAdmin">Copyright by STUNNIN 2011</div>
    </div>
	</body>
</html>